LINE
LINE_R

Syntax: LINE [#chan,] [x,y] [TO x1,y1] {[;x,y] [TO x,y] }
   and: LINE_R [#chan,] [x,y] [TO x1,y1] {[;x,y] [TO x,y] }
Location: QL ROM

LINE is part of the QL's graphics repertoire and allows you to draw a straight line in the specified channel (default #1) in the current INK colour between any two points. As with all of the other graphics commands, the exact size and position of the line depends upon the current SCALE.

Although the above syntax may seem rather complex, this can be explained as follows:

If the separator TO appears between any two sets of co-ordinates, then a line will be drawn between those two co-ordinates. If however the two sets of co-ordinates are the same, nothing will be drawn, eg:

LINE 10,10 TO 10,10

has no effect. If the start co-ordinates are not specified, then the current graphics cursor is used as the one end of the line, eg:
LINE 10,10 TO 15,10 TO 20,20 

will draw a line between the points (10,10) and (15,10) and then a line between (15,10) and (20,20). The graphics cursor is placed at the last set of co-ordinates.

If the separator TO does not appear, then no line is drawn and the graphics cursor is moved to the last set of co-ordinates. For example: 

LINE 10,10   and   
LINE 20,20,10,10 

have exactly the same effect - they both place the graphics cursor at the point (10,10).

Any part of the lines which lie outside of the specified channel will not be drawn, but no error will be reported.

LINE_R is the same as LINE, except that all co-ordinates are relative to the current graphics cursor.

Example:
LINE 50,50 TO 50+COS(ix)*50,50+SIN(ix)*50

CROSS-REFERENCE:
See also ELLIPSE, CIRCLE, ARC, POINT and SCALE.
